<!DOCTYPE HTML>
<html lang="en" class="light" dir="ltr">
    <head>
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>Components - The rustup book</title>


        <!-- Custom HTML head -->
        
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="../favicon.svg">
        <link rel="shortcut icon" href="../favicon.png">
        <link rel="stylesheet" href="../css/variables.css">
        <link rel="stylesheet" href="../css/general.css">
        <link rel="stylesheet" href="../css/chrome.css">
        <link rel="stylesheet" href="../css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="../fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" href="../highlight.css">
        <link rel="stylesheet" href="../tomorrow-night.css">
        <link rel="stylesheet" href="../ayu-highlight.css">

        <!-- Custom theme stylesheets -->

    </head>
    <body class="sidebar-visible no-js">
    <div id="body-container">
        <!-- Provide site root to javascript -->
        <script>
            var path_to_root = "../";
            var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
        </script>

        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                var theme = localStorage.getItem('mdbook-theme');
                var sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            var theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            var html = document.querySelector('html');
            html.classList.remove('light')
            html.classList.add(theme);
            var body = document.querySelector('body');
            body.classList.remove('no-js')
            body.classList.add('js');
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            var body = document.querySelector('body');
            var sidebar = null;
            var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            body.classList.remove('sidebar-visible');
            body.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <div class="sidebar-scrollbox">
                <ol class="chapter"><li class="chapter-item expanded affix "><a href="../index.html">Introduction</a></li><li class="chapter-item expanded "><a href="../installation/index.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../installation/windows.html"><strong aria-hidden="true">1.1.</strong> Windows</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../installation/windows-msvc.html"><strong aria-hidden="true">1.1.1.</strong> MSVC prerequisites</a></li></ol></li><li class="chapter-item expanded "><a href="../installation/other.html"><strong aria-hidden="true">1.2.</strong> Other installation methods</a></li><li class="chapter-item expanded "><a href="../installation/already-installed-rust.html"><strong aria-hidden="true">1.3.</strong> Already installed Rust?</a></li></ol></li><li class="chapter-item expanded "><a href="../concepts/index.html"><strong aria-hidden="true">2.</strong> Concepts</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../concepts/channels.html"><strong aria-hidden="true">2.1.</strong> Channels</a></li><li class="chapter-item expanded "><a href="../concepts/toolchains.html"><strong aria-hidden="true">2.2.</strong> Toolchains</a></li><li class="chapter-item expanded "><a href="../concepts/components.html" class="active"><strong aria-hidden="true">2.3.</strong> Components</a></li><li class="chapter-item expanded "><a href="../concepts/profiles.html"><strong aria-hidden="true">2.4.</strong> Profiles</a></li><li class="chapter-item expanded "><a href="../concepts/proxies.html"><strong aria-hidden="true">2.5.</strong> Proxies</a></li></ol></li><li class="chapter-item expanded "><a href="../basics.html"><strong aria-hidden="true">3.</strong> Basic usage</a></li><li class="chapter-item expanded "><a href="../overrides.html"><strong aria-hidden="true">4.</strong> Overrides</a></li><li class="chapter-item expanded "><a href="../cross-compilation.html"><strong aria-hidden="true">5.</strong> Cross-compilation</a></li><li class="chapter-item expanded "><a href="../environment-variables.html"><strong aria-hidden="true">6.</strong> Environment variables</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">7.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="../network-proxies.html"><strong aria-hidden="true">8.</strong> Network proxies</a></li><li class="chapter-item expanded "><a href="../examples.html"><strong aria-hidden="true">9.</strong> Examples</a></li><li class="chapter-item expanded "><a href="../security.html"><strong aria-hidden="true">10.</strong> Security</a></li><li class="chapter-item expanded "><a href="../faq.html"><strong aria-hidden="true">11.</strong> FAQ</a></li></ol>
            </div>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <!-- Track and set sidebar scroll position -->
        <script>
            var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
            sidebarScrollbox.addEventListener('click', function(e) {
                if (e.target.tagName === 'A') {
                    sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
                }
            }, { passive: true });
            var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
            sessionStorage.removeItem('sidebar-scroll');
            if (sidebarScrollTop) {
                // preserve sidebar scroll position when navigating via links within sidebar
                sidebarScrollbox.scrollTop = sidebarScrollTop;
            } else {
                // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
                var activeSection = document.querySelector('#sidebar .active');
                if (activeSection) {
                    activeSection.scrollIntoView({ block: 'center' });
                }
            }
        </script>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">The rustup book</h1>

                    <div class="right-buttons">
                        <a href="../print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>
                        <a href="https://github.com/rust-lang/rustup/tree/master/doc/user-guide" title="Git repository" aria-label="Git repository">
                            <i id="git-repository-button" class="fa fa-github"></i>
                        </a>
                        <a href="https://github.com/rust-lang/rustup/edit/master/doc/user-guide/src/concepts/components.md" title="Suggest an edit" aria-label="Suggest an edit">
                            <i id="git-edit-button" class="fa fa-edit"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="components"><a class="header" href="#components">Components</a></h1>
<p>Each <a href="toolchains.html">toolchain</a> has several “components”, some of which are required (like
<code>rustc</code>) and some that are optional (like <a href="https://github.com/rust-lang/rust-clippy"><code>clippy</code></a>). The <code>rustup component</code> command is used to manage the installed components. For example,
run <code>rustup component list</code> to see a list of available and installed
components.</p>
<p>Components can be added when installing a toolchain with the <code>--component</code>
flag. For example:</p>
<pre><code class="language-console">rustup toolchain install nightly --component rust-docs
</code></pre>
<p>Components can be added to an already-installed toolchain with the <code>rustup component</code> command:</p>
<pre><code class="language-console">rustup component add rust-docs
</code></pre>
<p>To make it easier to choose which components are installed, <code>rustup</code> has the
concept of “profiles” which provide named groupings of different components.
See the <a href="profiles.html">Profiles</a> chapter for more detail.</p>
<p>Most components have a target-triple suffix, such as
<code>rustc-x86_64-apple-darwin</code>, to signify the platform the component is for.</p>
<p>The set of available components may vary with different releases and
toolchains. The following is an overview of the different components:</p>
<ul>
<li><code>rustc</code> — The Rust compiler and <a href="https://doc.rust-lang.org/rustdoc/">Rustdoc</a>.</li>
<li><code>cargo</code> — <a href="https://doc.rust-lang.org/cargo/">Cargo</a> is a package manager and build tool.</li>
<li><code>rustfmt</code> — <a href="https://github.com/rust-lang/rustfmt">Rustfmt</a> is a tool for automatically formatting code.</li>
<li><code>rust-std</code> — This is the Rust <a href="https://doc.rust-lang.org/std/">standard library</a>. There is a separate
<code>rust-std</code> component for each target that <code>rustc</code> supports, such as
<code>rust-std-x86_64-pc-windows-msvc</code>. See the <a href="../cross-compilation.html">Cross-compilation</a> chapter for
more detail.</li>
<li><code>rust-docs</code> — This is a local copy of the <a href="https://doc.rust-lang.org/">Rust documentation</a>. Use the
<code>rustup doc</code> command to open the documentation in a web browser. Run <code>rustup doc --help</code> for more options.</li>
<li><code>rust-analyzer</code> — <a href="https://rust-analyzer.github.io/">rust-analyzer</a> is a language server that provides support
for editors and IDEs.</li>
<li><code>clippy</code> — <a href="https://github.com/rust-lang/rust-clippy">Clippy</a> is a lint tool that provides extra checks for common
mistakes and stylistic choices.</li>
<li><code>miri</code> — <a href="https://github.com/rust-lang/miri/">Miri</a> is an experimental Rust interpreter, which can be used for
checking for undefined-behavior.</li>
<li><code>rust-src</code> — This is a local copy of the source code of the Rust standard
library. This can be used by some tools, such as <a href="https://rust-analyzer.github.io/">rust-analyzer</a>, to provide
auto-completion for functions within the standard library; <a href="https://github.com/rust-lang/miri/">Miri</a> which is a
Rust interpreter; and Cargo’s experimental <a href="https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std">build-std</a> feature, which allows
you to rebuild the standard library locally.</li>
<li><code>rust-mingw</code> — This contains a linker and platform libraries for building on
the <code>x86_64-pc-windows-gnu</code> platform.</li>
<li><code>llvm-tools</code> — This component contains a collection of <a href="https://llvm.org/">LLVM</a> tools.
Note that this component has not been stabilized and may change in the
future and is provided as-is.
See <a href="https://github.com/rust-lang/rust/issues/85658">#85658</a>.</li>
<li><code>rustc-dev</code> — This component contains the compiler as a library. Most users
will not need this; it is only needed for development <em>of</em> tools that link
to the compiler, such as making modifications to <a href="https://github.com/rust-lang/rust-clippy">Clippy</a>.</li>
</ul>
<h3 id="previous-components"><a class="header" href="#previous-components">Previous components</a></h3>
<blockquote>
<p>See <a href="https://rust-lang.github.io/rustup/devel/concepts/components.html#previous-components">here</a>
for the latest version of this section.</p>
</blockquote>
<p>These components have been deprecated and are not published in new Rust releases.</p>
<ul>
<li><code>rls</code> — <a href="https://github.com/rust-lang/rls">RLS</a> is a language server that is deprecated and has been replaced
by rust-analyzer.</li>
<li><code>rust-analysis</code> — Metadata about the standard library, used by <a href="https://github.com/rust-lang/rls">RLS</a>.</li>
</ul>
<h2 id="component-availability"><a class="header" href="#component-availability">Component availability</a></h2>
<p>Not all components are available for all toolchains. Especially on the nightly
channel, some components may not be included if they are in a broken state.
The current status of all the components may be found on the <a href="https://rust-lang.github.io/rustup-components-history/">rustup
components history</a> page. See the <a href="channels.html#nightly-availability">Nightly availability</a> section for more
details.</p>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="../concepts/toolchains.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="../concepts/profiles.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="../concepts/toolchains.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="../concepts/profiles.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="../elasticlunr.min.js"></script>
        <script src="../mark.min.js"></script>
        <script src="../searcher.js"></script>

        <script src="../clipboard.min.js"></script>
        <script src="../highlight.js"></script>
        <script src="../book.js"></script>

        <!-- Custom JS scripts -->


    </div>
    </body>
</html>
